import request from '@/utils/request'
// ========================= 管理 ======================================
// Get Record
export const QueryZhenduan = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/zhenduan/manage/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}

// 流程通过或拒绝
export const FlowApplyRecord = (data) => {
  return request({
    url: '/v1/prse/zhenduan/manage/',
    method: 'post',
    data,
  })
}

// // // Dispatch Record
// // export const DispatchAnaysisReport = (data) => {
// //   return request({
// //     url: '/v1/prse/pptCourseware/manage/',
// //     method: 'post',
// //     data,
// //   })
// // }

export const FinishApplyRecord = (data) => {
  return request({
    url: '/v1/prse/zhenduan/finish/',
    method: 'post',
    data,
  })
}

// ------------------------- 用户 --------------------------------------

// Create My Record
export const CreateZhenduanRecord = (data) => {
  return request({
    url: '/v1/prse/zhenduan/my/',
    method: 'post',
    data,
  })
}

// Query My Record
export const QueryZhenduanRecord = (page, pageSize) => {
  return request({
    url: '/v1/prse/zhenduan/my/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
    },
  })
}

// Evaluate My Record
export const EvaluateMyRecord = (data) => {
  return request({
    url: '/v1/prse/zhenduan/myEvaluate/',
    method: 'post',
    data,
  })
}

// Preview My Hedging File
export const GetMyRecordPreviewImages = (rid) => {
  return request({
    url: '/v1/prse/zhenduan/my/dataPreView/',
    method: 'get',
    params: { rid },
  })
}

// ============================== 工作者 =========================
// Get Record
export const QueryZhenduanToMe = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/zhenduan/worker/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}

// // // Post Annex File
// // export const FinishAnnexPPTCoursewareToMe = (data) => {
// //   return request({
// //     url: '/v1/prse/pptCourseware/worker/',
// //     method: 'post',
// //     data,
// //   })
// // }
